package com.lx.video.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lx.bilibili.entity.Video;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public interface VideoMapper extends BaseMapper<Video> {

    @Select("SELECT\n" +
            "	* \n" +
            "FROM\n" +
            "	`user` a,\n" +
            "	video b \n" +
            "WHERE\n" +
            "	a.id = b.uid \n" +
            "	AND a.id = #{id} AND b.state = 1 \n" +
            "ORDER BY\n" +
            "	b.vcount DESC \n" +
            "	LIMIT 0,\n" +
            "	3")
    List<Video> getHotVideoByIdLimit(int id);
}
